<script>
function loadScript(src) {
  return new Promise(function(resolve, reject) {
    let script = document.createElement('script');
    script.src = src;

    script.onload = () => resolve(script);
    script.onerror = () => reject(new Error("Ошибка загрузки скрипта: " + src));

    document.head.append(script);
  });
}
</script>

<style>
.promise-avatar-example {
  border-radius: 50%;
  position: fixed;
  left: 10px;
  top: 10px;
}
</style>
